﻿using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using System.Data.Common;

namespace Chenxin.Lib.Business.DAL
{
    /// <summary>
    /// 数据访问类t_Contract_Infomation。
    /// </summary>
    public class t_Contract_Infomation
    {
        public t_Contract_Infomation()
        { }
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public static bool Exists(Guid ContractId)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select count(1) from t_Contract_Infomation where ContractId=@ContractId ");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            int cmdresult;
            object obj = db.ExecuteScalar(dbCommand);
            if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public static void Add(Chenxin.Lib.Business.Entity.t_Contract_Infomation model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_Contract_Infomation(");
            strSql.Append("AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,HousePrice,ContractDate,Compensate,VConfirmBook,BConfirmBook,ContractEquity,EquityPlace,EquityPerson,ReciveEquityDate,EquityDate,PawnInfo,DealDate,LoanInfo,LoanPrice,PayStyle,Remark,OtherProtocol,ParkingFee)");

            strSql.Append(" values (");
            strSql.Append("@AddTime,@UpdateCityId,@UpdateCityName,@UpdateCompanyId,@UpdateCompanyName,@UpdateDepartmentId,@UpdateDepartmentName,@UpdateUserId,@UpdateUserName,@UpdateTime,@AddCityId,@AddCityName,@AddCompanyId,@AddCompanyName,@AddDepartmentId,@AddDepartmentName,@AddUserId,@AddUserName,@ContractId,@HousePrice,@ContractDate,@Compensate,@VConfirmBook,@BConfirmBook,@ContractEquity,@EquityPlace,@EquityPerson,@ReciveEquityDate,@EquityDate,@PawnInfo,@DealDate,@LoanInfo,@LoanPrice,@PayStyle,@Remark,@OtherProtocol,@ParkingFee)");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "AddTime", DbType.DateTime, model.AddTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "AddCityId", DbType.Guid, model.AddCityId);
            db.AddInParameter(dbCommand, "AddCityName", DbType.AnsiString, model.AddCityName);
            db.AddInParameter(dbCommand, "AddCompanyId", DbType.Guid, model.AddCompanyId);
            db.AddInParameter(dbCommand, "AddCompanyName", DbType.AnsiString, model.AddCompanyName);
            db.AddInParameter(dbCommand, "AddDepartmentId", DbType.Guid, model.AddDepartmentId);
            db.AddInParameter(dbCommand, "AddDepartmentName", DbType.AnsiString, model.AddDepartmentName);
            db.AddInParameter(dbCommand, "AddUserId", DbType.Guid, model.AddUserId);
            db.AddInParameter(dbCommand, "AddUserName", DbType.AnsiString, model.AddUserName);
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, model.ContractId);
            db.AddInParameter(dbCommand, "HousePrice", DbType.Decimal, model.HousePrice);
            db.AddInParameter(dbCommand, "ContractDate", DbType.DateTime, model.ContractDate);
            db.AddInParameter(dbCommand, "Compensate", DbType.Decimal, model.Compensate);
            db.AddInParameter(dbCommand, "VConfirmBook", DbType.AnsiString, model.VConfirmBook);
            db.AddInParameter(dbCommand, "BConfirmBook", DbType.AnsiString, model.BConfirmBook);
            db.AddInParameter(dbCommand, "ContractEquity", DbType.String, model.ContractEquity);
            db.AddInParameter(dbCommand, "EquityPlace", DbType.String, model.EquityPlace);
            db.AddInParameter(dbCommand, "EquityPerson", DbType.String, model.EquityPerson);
            db.AddInParameter(dbCommand, "ReciveEquityDate", DbType.DateTime, model.ReciveEquityDate);
            db.AddInParameter(dbCommand, "EquityDate", DbType.DateTime, model.EquityDate);
            db.AddInParameter(dbCommand, "PawnInfo", DbType.String, model.PawnInfo);
            db.AddInParameter(dbCommand, "DealDate", DbType.DateTime, model.DealDate);
            db.AddInParameter(dbCommand, "LoanInfo", DbType.String, model.LoanInfo);
            db.AddInParameter(dbCommand, "LoanPrice", DbType.Decimal, model.LoanPrice);
            db.AddInParameter(dbCommand, "PayStyle", DbType.String, model.PayStyle);
            db.AddInParameter(dbCommand, "Remark", DbType.String, model.Remark);
            db.AddInParameter(dbCommand, "OtherProtocol", DbType.String, model.OtherProtocol);
            db.AddInParameter(dbCommand, "ParkingFee", DbType.Decimal, model.ParkingFee);
            db.ExecuteNonQuery(dbCommand);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static void Update(Chenxin.Lib.Business.Entity.t_Contract_Infomation model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("update t_Contract_Infomation set ");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("UpdateCityId=@UpdateCityId,");
            strSql.Append("UpdateCityName=@UpdateCityName,");
            strSql.Append("UpdateCompanyId=@UpdateCompanyId,");
            strSql.Append("UpdateCompanyName=@UpdateCompanyName,");
            strSql.Append("UpdateDepartmentId=@UpdateDepartmentId,");
            strSql.Append("UpdateDepartmentName=@UpdateDepartmentName,");
            strSql.Append("UpdateUserId=@UpdateUserId,");
            strSql.Append("UpdateUserName=@UpdateUserName,");
            strSql.Append("UpdateTime=@UpdateTime,");
            strSql.Append("AddCityId=@AddCityId,");
            strSql.Append("AddCityName=@AddCityName,");
            strSql.Append("AddCompanyId=@AddCompanyId,");
            strSql.Append("AddCompanyName=@AddCompanyName,");
            strSql.Append("AddDepartmentId=@AddDepartmentId,");
            strSql.Append("AddDepartmentName=@AddDepartmentName,");
            strSql.Append("AddUserId=@AddUserId,");
            strSql.Append("AddUserName=@AddUserName,");
            strSql.Append("HousePrice=@HousePrice,");
            strSql.Append("ContractDate=@ContractDate,");
            strSql.Append("Compensate=@Compensate,");
            strSql.Append("VConfirmBook=@VConfirmBook,");
            strSql.Append("BConfirmBook=@BConfirmBook,");
            strSql.Append("ContractEquity=@ContractEquity,");
            strSql.Append("EquityPlace=@EquityPlace,");
            strSql.Append("EquityPerson=@EquityPerson,");
            strSql.Append("ReciveEquityDate=@ReciveEquityDate,");
            strSql.Append("EquityDate=@EquityDate,");
            strSql.Append("PawnInfo=@PawnInfo,");
            strSql.Append("DealDate=@DealDate,");
            strSql.Append("LoanInfo=@LoanInfo,");
            strSql.Append("LoanPrice=@LoanPrice,");
            strSql.Append("PayStyle=@PayStyle,");
            strSql.Append("Remark=@Remark,");
            strSql.Append("OtherProtocol=@OtherProtocol,");
            strSql.Append("ParkingFee=@ParkingFee");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "AddTime", DbType.DateTime, model.AddTime);
            db.AddInParameter(dbCommand, "UpdateCityId", DbType.Guid, model.UpdateCityId);
            db.AddInParameter(dbCommand, "UpdateCityName", DbType.AnsiString, model.UpdateCityName);
            db.AddInParameter(dbCommand, "UpdateCompanyId", DbType.Guid, model.UpdateCompanyId);
            db.AddInParameter(dbCommand, "UpdateCompanyName", DbType.AnsiString, model.UpdateCompanyName);
            db.AddInParameter(dbCommand, "UpdateDepartmentId", DbType.Guid, model.UpdateDepartmentId);
            db.AddInParameter(dbCommand, "UpdateDepartmentName", DbType.AnsiString, model.UpdateDepartmentName);
            db.AddInParameter(dbCommand, "UpdateUserId", DbType.Guid, model.UpdateUserId);
            db.AddInParameter(dbCommand, "UpdateUserName", DbType.AnsiString, model.UpdateUserName);
            db.AddInParameter(dbCommand, "UpdateTime", DbType.DateTime, model.UpdateTime);
            db.AddInParameter(dbCommand, "AddCityId", DbType.Guid, model.AddCityId);
            db.AddInParameter(dbCommand, "AddCityName", DbType.AnsiString, model.AddCityName);
            db.AddInParameter(dbCommand, "AddCompanyId", DbType.Guid, model.AddCompanyId);
            db.AddInParameter(dbCommand, "AddCompanyName", DbType.AnsiString, model.AddCompanyName);
            db.AddInParameter(dbCommand, "AddDepartmentId", DbType.Guid, model.AddDepartmentId);
            db.AddInParameter(dbCommand, "AddDepartmentName", DbType.AnsiString, model.AddDepartmentName);
            db.AddInParameter(dbCommand, "AddUserId", DbType.Guid, model.AddUserId);
            db.AddInParameter(dbCommand, "AddUserName", DbType.AnsiString, model.AddUserName);
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, model.ContractId);
            db.AddInParameter(dbCommand, "HousePrice", DbType.Decimal, model.HousePrice);
            db.AddInParameter(dbCommand, "ContractDate", DbType.DateTime, model.ContractDate);
            db.AddInParameter(dbCommand, "Compensate", DbType.Decimal, model.Compensate);
            db.AddInParameter(dbCommand, "VConfirmBook", DbType.AnsiString, model.VConfirmBook);
            db.AddInParameter(dbCommand, "BConfirmBook", DbType.AnsiString, model.BConfirmBook);
            db.AddInParameter(dbCommand, "ContractEquity", DbType.String, model.ContractEquity);
            db.AddInParameter(dbCommand, "EquityPlace", DbType.String, model.EquityPlace);
            db.AddInParameter(dbCommand, "EquityPerson", DbType.String, model.EquityPerson);
            db.AddInParameter(dbCommand, "ReciveEquityDate", DbType.DateTime, model.ReciveEquityDate);
            db.AddInParameter(dbCommand, "EquityDate", DbType.DateTime, model.EquityDate);
            db.AddInParameter(dbCommand, "PawnInfo", DbType.String, model.PawnInfo);
            db.AddInParameter(dbCommand, "DealDate", DbType.DateTime, model.DealDate);
            db.AddInParameter(dbCommand, "LoanInfo", DbType.String, model.LoanInfo);
            db.AddInParameter(dbCommand, "LoanPrice", DbType.Decimal, model.LoanPrice);
            db.AddInParameter(dbCommand, "PayStyle", DbType.String, model.PayStyle);
            db.AddInParameter(dbCommand, "Remark", DbType.String, model.Remark);
            db.AddInParameter(dbCommand, "OtherProtocol", DbType.String, model.OtherProtocol);
            db.AddInParameter(dbCommand, "ParkingFee", DbType.Decimal, model.ParkingFee);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public static void Delete(Guid ContractId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("delete from t_Contract_Infomation ");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            db.ExecuteNonQuery(dbCommand);

        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Contract_Infomation GetModel(Guid ContractId)
        {

            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,HousePrice,ContractDate,Compensate,VConfirmBook,BConfirmBook,ContractEquity,EquityPlace,EquityPerson,ReciveEquityDate,EquityDate,PawnInfo,DealDate,LoanInfo,LoanPrice,PayStyle,Remark,OtherProtocol,ParkingFee from t_Contract_Infomation ");
            strSql.Append(" where ContractId=@ContractId ");
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
            db.AddInParameter(dbCommand, "ContractId", DbType.Guid, ContractId);
            Chenxin.Lib.Business.Entity.t_Contract_Infomation model = null;
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public static DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,HousePrice,ContractDate,Compensate,VConfirmBook,BConfirmBook,ContractEquity,EquityPlace,EquityPerson,ReciveEquityDate,EquityDate,PawnInfo,DealDate,LoanInfo,LoanPrice,PayStyle,Remark,OtherProtocol,ParkingFee ");
            strSql.Append(" FROM t_Contract_Infomation ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            return db.ExecuteDataSet(CommandType.Text, strSql.ToString());
        }


        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public static DataSet GetList(int PageIndex, int PageSize, String OrderField, string TableName, string StrWhere, string FieldList, string TableFieldList, bool DoCount)
        {
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            DbCommand dbCommand = db.GetStoredProcCommand("PagerMultiTable");
            db.AddInParameter(dbCommand, "PageIndex", DbType.Int32, PageIndex);
            db.AddInParameter(dbCommand, "PageSize", DbType.Int32, PageSize);
            db.AddInParameter(dbCommand, "OrderField", DbType.AnsiString, OrderField);
            db.AddInParameter(dbCommand, "TableName", DbType.AnsiString, TableName);
            db.AddInParameter(dbCommand, "StrWhere", DbType.AnsiString, StrWhere);
            db.AddInParameter(dbCommand, "FieldList", DbType.AnsiString, FieldList);
            db.AddInParameter(dbCommand, "TableFieldList", DbType.AnsiString, TableFieldList);
            db.AddInParameter(dbCommand, "DoCount", DbType.Boolean, DoCount);
            return db.ExecuteDataSet(dbCommand);
        }

        /// <summary>
        /// 获得数据列表（比DataSet效率高，推荐使用）
        /// </summary>
        public static List<Chenxin.Lib.Business.Entity.t_Contract_Infomation> GetListArray(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select AddTime,UpdateCityId,UpdateCityName,UpdateCompanyId,UpdateCompanyName,UpdateDepartmentId,UpdateDepartmentName,UpdateUserId,UpdateUserName,UpdateTime,AddCityId,AddCityName,AddCompanyId,AddCompanyName,AddDepartmentId,AddDepartmentName,AddUserId,AddUserName,ContractId,HousePrice,ContractDate,Compensate,VConfirmBook,BConfirmBook,ContractEquity,EquityPlace,EquityPerson,ReciveEquityDate,EquityDate,PawnInfo,DealDate,LoanInfo,LoanPrice,PayStyle,Remark,OtherProtocol,ParkingFee ");
            strSql.Append(" FROM t_Contract_Infomation ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Chenxin.Lib.Business.Entity.t_Contract_Infomation> list = new List<Chenxin.Lib.Business.Entity.t_Contract_Infomation>();
            Database db = DatabaseFactory.CreateDatabase("Chenxin_Business_Search");
            using (IDataReader dataReader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
            {
                while (dataReader.Read())
                {
                    list.Add(ReaderBind(dataReader));
                }
                dataReader.Close();
                dataReader.Dispose();
            }
            return list;
        }


        /// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public static Chenxin.Lib.Business.Entity.t_Contract_Infomation ReaderBind(IDataReader dataReader)
        {
            Chenxin.Lib.Business.Entity.t_Contract_Infomation model = new Chenxin.Lib.Business.Entity.t_Contract_Infomation();
            object ojb;
            ojb = dataReader["AddTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddTime = (DateTime)ojb;
            }
            ojb = dataReader["UpdateCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCityId = new Guid(ojb.ToString());
            }
            model.UpdateCityName = dataReader["UpdateCityName"].ToString();
            ojb = dataReader["UpdateCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateCompanyId = new Guid(ojb.ToString());
            }
            model.UpdateCompanyName = dataReader["UpdateCompanyName"].ToString();
            ojb = dataReader["UpdateDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateDepartmentId = new Guid(ojb.ToString());
            }
            model.UpdateDepartmentName = dataReader["UpdateDepartmentName"].ToString();
            ojb = dataReader["UpdateUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateUserId = new Guid(ojb.ToString());
            }
            model.UpdateUserName = dataReader["UpdateUserName"].ToString();
            ojb = dataReader["UpdateTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UpdateTime = (DateTime)ojb;
            }
            ojb = dataReader["AddCityId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddCityId = new Guid(ojb.ToString());
            }
            model.AddCityName = dataReader["AddCityName"].ToString();
            ojb = dataReader["AddCompanyId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddCompanyId = new Guid(ojb.ToString());
            }
            model.AddCompanyName = dataReader["AddCompanyName"].ToString();
            ojb = dataReader["AddDepartmentId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddDepartmentId = new Guid(ojb.ToString());
            }
            model.AddDepartmentName = dataReader["AddDepartmentName"].ToString();
            ojb = dataReader["AddUserId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AddUserId = new Guid(ojb.ToString());
            }
            model.AddUserName = dataReader["AddUserName"].ToString();
            ojb = dataReader["ContractId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ContractId = new Guid(ojb.ToString());
            }
            ojb = dataReader["HousePrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.HousePrice = (decimal)ojb;
            }
            ojb = dataReader["ContractDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ContractDate = (DateTime)ojb;
            }
            ojb = dataReader["Compensate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Compensate = (decimal)ojb;
            }
            model.VConfirmBook = dataReader["VConfirmBook"].ToString();
            model.BConfirmBook = dataReader["BConfirmBook"].ToString();
            model.ContractEquity = dataReader["ContractEquity"].ToString();
            model.EquityPlace = dataReader["EquityPlace"].ToString();
            model.EquityPerson = dataReader["EquityPerson"].ToString();
            ojb = dataReader["ReciveEquityDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ReciveEquityDate = (DateTime)ojb;
            }
            ojb = dataReader["EquityDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.EquityDate = (DateTime)ojb;
            }
            model.PawnInfo = dataReader["PawnInfo"].ToString();
            ojb = dataReader["DealDate"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.DealDate = (DateTime)ojb;
            }
            model.LoanInfo = dataReader["LoanInfo"].ToString();
            ojb = dataReader["LoanPrice"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LoanPrice = (decimal)ojb;
            }
            model.PayStyle = dataReader["PayStyle"].ToString();
            model.Remark = dataReader["Remark"].ToString();
            model.OtherProtocol = dataReader["OtherProtocol"].ToString();
            ojb = dataReader["ParkingFee"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ParkingFee = (decimal)ojb;
            }
            return model;
        }

        #endregion  成员方法
    }
}

